use clap::Parser;
use wtask_base::{error::WResult, logs::log_init, update::get_local_version};

use crate::utils::{get_install_file, get_remove_version, CMDArgs};


#[test]
fn test_local_version() -> WResult<()> {
    let version_local = get_local_version();
    assert_eq!(version_local, "".to_string());
    Ok(())
}


#[test]
fn test_remote() -> WResult<()> {
    let mut args = CMDArgs::parse_from(Vec::<String>::new());
    log_init(&args.log_args);
    let version_remote = get_remove_version(&args)?;
    assert_eq!(version_remote, "20250721182626".to_string());
    args.ver = Some(version_remote.clone());
    let file_install = get_install_file(&args)?;
    println!("file_install: {file_install:?}");
    Ok(())
}